package com.company;

public class TaxiChargeLZZ {
    //里程数按照米计算，时间按照秒计算
    public double calculate(double mileage,double time){
        if (mileage<0||time<0){
            return 0;
        }
        mileage=mileage/1000;
        time=time/60;
        double totalPrice=0;
        if(mileage<=8){
            totalPrice+=mileage*0.8;
        }else if(mileage>8){
            totalPrice+=6.4+(mileage-8)*0.8*1.5;
        }
        totalPrice+=time*0.25;
        return totalPrice;
    }
}
